import { AST, Token } from ".";

let plusToken = new Token(Token.PLUS,"+");
let oneToken = new Token(Token.INT,"1");
let twoToken = new Token(Token.INT,"2");

let root = new AST(plusToken);
root.addChild(new AST(oneToken));
root.addChild(new AST(twoToken));

let list = new AST();
list.addChild(new AST(oneToken));
list.addChild(new AST(twoToken))

// 1 + 2    中缀形式   对人阅读友好
// (+ 1 2)  前缀形式   语法树描述友好
// 1 2 +    后缀形式   对机器运算友好 data [3]  []
console.log("1 + 2 tree------",root.toStringTree())
console.log("1 and 2 in list-----",list.toStringTree())